package com.cy.store.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @PROJECT_NAME: store
 * @DESCRIPTION:
 * @USER: 28416
 * @DATE: 2022/11/3 17:26
 */
@Configuration
public class InitConfig  implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        //设置访问路径为 “/” 跳转到指定页面
        registry.addViewController("/").setViewName("forward:/web/index.html");
        registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
    }

}
